package com.fy.market.strategy.service.rule.tree.treeFactory;

import com.fy.market.strategy.model.entity.tree.valobj.RuleTreeVO;
import com.fy.market.strategy.service.rule.tree.ILogicTreeNode;
import com.fy.market.strategy.service.rule.tree.treeFactory.engine.IDecisionTreeEngine;
import com.fy.market.strategy.service.rule.tree.treeFactory.engine.impl.DecisionTreeEngine;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * @author fwq
 * @desc 决策树工厂
 * @date 2025年09月25
 */
@Service
public class LogicTreeFactory {

    private final Map<String, ILogicTreeNode> iLogicTreeNodeMap;

    public LogicTreeFactory(Map<String, ILogicTreeNode> iLogicTreeNodeMap) {
        this.iLogicTreeNodeMap = iLogicTreeNodeMap;
    }

    public IDecisionTreeEngine openLogicTree(RuleTreeVO ruleTreeVO) {
        return new DecisionTreeEngine(iLogicTreeNodeMap, ruleTreeVO);
    }
}
